This page was generated from
doc/documents/notebooks/placement.ipynb.
Interactive online version:
-
Download notebook -
Interactive online version:
Placement of parts and objects¶
Placement of every object in adapy can be controlled using the ada.Placement object.
[1]:
import ada
First let’s check out how we might use rotat
[2]:
bm = ada.Beam('bm1', (0,0,0), (1,0,0), 'IPE300')
other_beams = []
for i, angle in enumerate([45, 90, 135, 180], start=2):
bm2 = bm.copy_to(f"bm{i}", (0,0,i-1), (1,0,i-1))
bm2.placement = bm2.placement.rotate((0,0,1), angle)
other_beams.append(bm2)
p = ada.Part('MyPart') / (bm, *other_beams)
p.show(embed_glb=True)
C:\AibelProgs\code\adapy\.pixi\envs\tests\Lib\site-packages\h5py\__init__.py:36: UserWarning: h5py is running against HDF5 (1, 14, 4) when it was built against (1, 14, 4, 3), this may cause problems
_warn(("h5py is running against HDF5 {0} when it was built against {1}, "
[2]:
[5]:
w = 5
pl = ada.Plate('pl1', [(0,0), (w,0), (w,w), (0,w)], 0.01)
beams = ada.Beam.array_from_list_of_coords(pl.poly.points3d,'IPE300', make_closed=True)
p = ada.Part('myPart') / (pl, *beams)
copied_p = p.copy_to('my_copied_part', (0,0,1))
copied_p.placement = copied_p.placement.rotate((0,0,1), 45)
p_top = ada.Part('TopPart') / (p, copied_p)
p_top.show(embed_glb=True)
[5]: